Hi, |
Re: Link two different modules using an unique attribute So link oA to oB when they share the same attribute value. here's a possible outline.
// create skip list lookup of B objects with UniqueValue
Skip skpObjectsB = createString()
for oB in mB do
{ Value = oB."UniqueAttribute"
put(skpObjectsB, Value, oB) // optionally check for duplicates
}
for oA in mA do
{ Value = oA."UniqueAttribute"
lnkActual = find existing link to oB, if any
oBActual = oB this oA is linked to, if any
if (find (skpObjectsB, Value, oBDesired))
{ // we want a link from this oA
if (oBActual == oBDesired) then link already exists, nothing to do
else
{ // need a link
if (!null oBActual) then delete Link lnkActual since its the wrong link
link oA to oBDesired
}
}
else
{ // we do not want a link from this oA
if (!null oBActual) then delete Link lnkActual since its the wrong link
}
}
delete(skpObjectsB)
|
Re: Link two different modules using an unique attribute
|
Re: Link two different modules using an unique attribute Thanks so much. I was able to do this with the script and its done. BR, Ashok |